package com.nttdata.ocr.exception;

/**
 * 业务异常枚举类
 */
public enum ExceptionEnum {

    /**
     * 传入的参数有问题
     */
    PARAM_ERROR(1001, "参数有误"),

    /**
     *  paddle_ocr 识别图片发生错误
     */
    PADDLE_OCR_ERROR(1101, "识别图片出错"),

    OCR_BASE64_SAVE_TO_IMG_ERROR(1102, "base64字符串转图片出错"),

    LICENSE_OCR_ERROR(1200, "未识别出有效车辆"),

    ID_CARD_OCR_ERROR(1200, "未识别出有效身份证号"),

    /**
     * access_token 无效
     */
    TOKEN_INVALID(1301, "token无效"),

    /**
     * access_token 创建失败
     */
    TOKEN_CREATE_FAIL(1302, "access_token 获取失败,appKey 或 appSecret 不正确"),

    /**
     * access_token刷新失败
     */
    TOKEN_REFRESH_FAIL(1303, "access_token刷新失败");

    private int code;

    private String message;

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    ExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
